<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let x = /^a/
        let y = 'abctyy6x'
        console.log(x.test(y))//y是否以a开头

        let z =/x$/
        console.log(z.test(y))//y是否以x结尾

        let w=/a.c/
        console.log(w.test(y))//检验a后是否有c

    </script>
</body>
</html>